#include <stdio.h>
#include <stdlib.h>
//找到所有数组中消失的数字
int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize)
{
    int* hash = (int*)malloc(sizeof(int) * (numsSize + 1));
    int i = 0;
    for (i = 0; i < numsSize; i++)
    {
        hash[nums[i]] = 1;
    }
    *returnSize = 0;
    for (i = 1; i <= numsSize; i++)
    {
        if (hash[i] != 1)
        {
            hash[(*returnSize)++] = i;
        }
    }
    return hash;
}

int main()
{
    int nums[] = { 4,3,2,7,8,2,3,1 };
    int numsSize = sizeof(nums) / sizeof(nums[0]);
    int a = 0;
    int* ret = findDisappearedNumbers(nums, numsSize, &a);
    int i = 0;
    for (i = 0; i < a; i++)
    {
        printf("%d ", ret[i]);
    }
    return 0;
}